<!--
 * @Author: @xiaonancheng
 * @Date: 2023-03-14 14:33:33
 * https://www.cnblogs.com/xiaonancheng
 * Copyright (c) 2023 by @xiaonancheng, All Rights Reserved. 
-->
{% extends "user_base.html" %}
{% block title %}
线上咨询
{% endblock %}

{% block subtitle %}
线上咨询 <li class="breadcrumb-item">选择医生</li>
{% endblock %}


{% block main %}线上咨询{% endblock %}

{% block content %}





<section class="section">
  <div class="row">
    <div class="col-lg-12">

      <!-- Default Card -->
      <div class="card">
        <div class="card-body">
          <h5 class="card-title">科室介绍</h5>

          <div class="row mb-3">
            <label class="col-sm-4 col-form-label">选择科室</label>

            <div class="col-sm-6">
              <select class="form-select" aria-label="Default select example" id="department">
                <option selected></option>
                {% for d in departments %}

                <option value={{d.id}}>{{d.d_name}}</option>

                {% endfor %}
              </select>
            </div>
          </div>

          <div id="dintroduce">
            {{de.introduce}}
          </div>
        </div><!-- End Default Card -->
        <script>
          $("#department").on("change", function () {
            location.href = "http://127.0.0.1:8000/user/online_consult/?deid=" + $("#department").val()
          })
          $(function () {
            $("#department").val({{ de.id }})
            })

        </script>


      </div>
      <!-- End Card with header and footer -->
      <div class="row">
        {% for d in doctors %}
        <div class="col-lg-3 col-md-3">

          <!-- Card with an image on top -->
          <div class="card">
            <img src="{{d.profile}}" class="card-img-top" alt="...">
            <div class="card-body">
              <h5 class="card-title">{{d.doctor_name}}</h5>
              <p class="card-text">{{d.good_at}}</p>
              <a href="{% url 'UserApp:online_consult'%}?did={{d.uid}}" class="btn btn-primary">咨询</a>

            </div><!-- End Card with an image on top -->
          </div>
        </div>
        {% endfor %}
      </div>

    </div>
</section>








{% endblock %}